<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	template="/WEB-INF/jsf/template.xhtml">

	<ui:define name="content">
		<h:form prependId="false">
			<p:commandButton image="back" ajax="false" immediate="true" style="margin-right:20px;" value="#{patientmsgs['navigation.back']}" action="/jsf/patient/listPatients.xhtml"/>
		
			<p:panel header="#{patientmsgs['patient.title']} Details" style="margin-top:10px">
				<p:messages />
				<h:panelGrid id="detail" columns="2" styleClass="grid" columnClasses="label,value">
						<h:outputText value="#{patientmsgs['patient.patpatient.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patPatient}"/>
						<h:outputText value="#{patientmsgs['patient.patdateentree.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patDateEntree}"  converter="dateConverterForCalendar" />
						<h:outputText value="#{patientmsgs['patient.pattelcontact.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patTelContact}"/>
						<h:outputText value="#{patientmsgs['patient.patdivers.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patDivers}"/>
						<h:outputText value="#{patientmsgs['patient.patdatesortie.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patDateSortie}"  converter="dateConverterForCalendar" />
						<h:outputText value="#{patientmsgs['patient.pataxemedical.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patAxeMedical}"/>
						<h:outputText value="#{patientmsgs['patient.patsousaxemedical.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patSousAxeMedical}"/>
						<h:outputText value="#{patientmsgs['patient.patmotifsortie.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patMotifSortie}"/>
						<h:outputText value="#{patientmsgs['patient.patdiagnostic.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patDiagnostic}"/>
						<h:outputText value="#{patientmsgs['patient.patdatedernierevisite.title']}:" />
							<h:outputText value="#{PatientComponent.patient.patDateDerniereVisite}"  converter="dateConverterForCalendar" />
				</h:panelGrid>
			</p:panel>

			<p:panel header="#{patientmsgs['tiers.title']} Details" style="margin-top:10px">
				<p:messages />
				<h:panelGrid id="tiers" columns="2" styleClass="grid" columnClasses="label,value" rendered="#{PatientComponent.patient.tiers != null}" >
					<h:outputText value="#{patientmsgs['tiers.tietiers.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieTiers}"/>
					<h:outputText value="#{patientmsgs['tiers.tieidentclient.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieIdentClient}"/>
					<h:outputText value="#{patientmsgs['tiers.tietypetiers.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieTypeTiers}"/>
					<h:outputText value="#{patientmsgs['tiers.tielibexterne.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieLibExterne}"/>
					<h:outputText value="#{patientmsgs['tiers.tienationalite.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieNationalite}"/>
					<h:outputText value="#{patientmsgs['tiers.tietelfix.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieTelFix}"/>
					<h:outputText value="#{patientmsgs['tiers.tietelbureau.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieTelBureau}"/>
					<h:outputText value="#{patientmsgs['tiers.tietelportable.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieTelPortable}"/>
					<h:outputText value="#{patientmsgs['tiers.tiefax.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieFax}"/>
					<h:outputText value="#{patientmsgs['tiers.tieemail.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieEMail}"/>
					<h:outputText value="#{patientmsgs['tiers.tiedatecreation.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieDateCreation}"  converter="dateConverterForCalendar" />
					<h:outputText value="#{patientmsgs['tiers.tieusercreation.title']}:" />
							<h:outputText value="#{PatientComponent.patient.tiers.tieUserCreation}"/>
				</h:panelGrid>
				<h:panelGrid columns="2" styleClass="grid" columnClasses="label,value" rendered="#{PatientComponent.patient.tiers != null}" >
					<p:commandButton image="edit" ajax="false" style="margin-right:20px;" value="#{patientmsgs['navigation.edit']}" action="#{PatientComponent.editPatientTiers(PatientComponent.patient.patPatient, PatientComponent.patient.tiers.tieTiers)}"/>
					<p:commandButton image="delete" ajax="false" style="margin-right:20px;" value="#{patientmsgs['navigation.delete']}" action="#{PatientComponent.confirmDeletePatientTiers(PatientComponent.patient.patPatient, PatientComponent.patient.tiers.tieTiers)}"/>
				</h:panelGrid>
				<h:panelGrid columns="1" styleClass="grid" columnClasses="label,value" rendered="#{PatientComponent.patient.tiers == null}" >
					<p:commandButton image="new" ajax="false" style="margin-right:20px;" value="#{patientmsgs['navigation.new']}" action="#{PatientComponent.newPatientTiers(PatientComponent.patient.patPatient)}"/>
				</h:panelGrid>
			</p:panel>
			<p:panel header="#{patientmsgs['rendezvous.title']} Details" style="margin-top:10px">
			<p:commandButton image="new" ajax="false" style="margin-right:20px;" value="#{patientmsgs['navigation.new']}" action="#{PatientComponent.newPatientRendezVouses(PatientComponent.patient.patPatient)}"/>
			<p:dataTable id="rendezVouses" value="#{PatientComponent.listPatientRendezVouses(PatientComponent.patient.patPatient)}"  var="current" rows="10" paginator="true" paginatorPosition="bottom">
				<p:column>
					<h:commandLink includeViewParams="true" action="#{PatientComponent.selectPatientRendezVouses(PatientComponent.patient.patPatient, current.rdvRendezVous)}" >
						<h:graphicImage value="/images/icons/view.gif" style="border:0;"/>
					</h:commandLink>
					<h:commandLink includeViewParams="true" action="#{PatientComponent.editPatientRendezVouses(PatientComponent.patient.patPatient, current.rdvRendezVous)}" >
						<h:graphicImage value="/images/icons/edit.gif" style="border:0;"/>
					</h:commandLink>
					<h:commandLink includeViewParams="true" action="#{PatientComponent.confirmDeletePatientRendezVouses(PatientComponent.patient.patPatient, current.rdvRendezVous)}" >
						<h:graphicImage value="/images/icons/delete.gif" style="border:0;"/>
					</h:commandLink>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['rendezvous.rdvrendezvous.title']}" />
					</f:facet>
							<h:outputText value="#{current.rdvRendezVous}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['rendezvous.rdvtiers.title']}" />
					</f:facet>
							<h:outputText value="#{current.rdvTiers}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['rendezvous.rdvspecialite.title']}" />
					</f:facet>
							<h:outputText value="#{current.rdvSpecialite}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['rendezvous.rdvdate.title']}" />
					</f:facet>
							<h:outputText value="#{current.rdvDate}"  converter="dateConverterForCalendar" />
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['rendezvous.rdvadmission.title']}" />
					</f:facet>
							<h:outputText value="#{current.rdvAdmission}"/>
				</p:column>
			</p:dataTable>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>